package com.xjzd.spring.validated;

import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class NotEmptyValidator implements ConstraintValidator<ValidNotEmpty, String> {

    @Override
    public boolean isValid(String name, ConstraintValidatorContext context) {
        System.out.println("校验 UserDTO"); // 输出两次
        return name != null && !name.trim().isEmpty();
    }
}
